<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
class Make_test extends CI_Model{
    public function __construct() {
        parent::__construct();
        $this->load->database();
    }
    public function getCSV()
    {
        $this->db->select('*');
        $this->db->from('csv'); 
        $this->db->where('state',0);
        $query=$this->db->get();
        return $query;
    }
    public function get_test()
    { 
        $sql="SELECT DISTINCT testtitle FROM tester";
        $query=$this->db->query($sql);
        return $query;
    }
    public function get_Mark($testtitle)
    {
        $this->db->select('*');
        $this->db->from('tester');
        $this->db->where('testtitle',$testtitle);
        $this->db->order_by('sum_mark', 'desc'); 
        $query=$this->db->get();
        return $query;
    }
}
?>
